home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / ConditionalMacros.p < prev    next >
Encoding:
Text File  |  1997-08-12  |  10.4 KB  |  291 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        ConditionalMacros.p
  3.  
  4.      Contains:    Set up for compiler independent conditionals
  5.  
  6.      Version:    Technology:    Universal Interface Files 3.0.1
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1993-1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT ConditionalMacros;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __CONDITIONALMACROS__}
  28. {$SETC __CONDITIONALMACROS__ := 1}
  29.  
  30. {$I+}
  31. {$SETC ConditionalMacrosIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {***************************************************************************************************
  35.     UNIVERSAL_INTERFACES_VERSION
  36.     
  37.         0x0301 => version 3.0.1
  38.         0x0300 => version 3.0
  39.         0x0210 => version 2.1
  40.         This conditional did not exist prior to version 2.1
  41. ***************************************************************************************************}
  42. {$SETC UNIVERSAL_INTERFACES_VERSION := $0301}
  43.  
  44. {***************************************************************************************************
  45.  
  46.     TARGET_CPU_≈    
  47.     These conditionals specify which microprocessor instruction set is being
  48.     generated.  At most one of these is true, the rest are false.
  49.  
  50.         TARGET_CPU_PPC            - Compiler is generating PowerPC instructions
  51.         TARGET_CPU_68K            - Compiler is generating 680x0 instructions
  52.         TARGET_CPU_X86            - Compiler is generating x86 instructions
  53.         TARGET_CPU_MIPS            - Compiler is generating MIPS instructions
  54.         TARGET_CPU_SPARC        - Compiler is generating Sparc instructions
  55.         TARGET_CPU_ALPHA        - Compiler is generating Dec Alpha instructions
  56.  
  57.  
  58.     TARGET_OS_≈    
  59.     These conditionals specify in which Operating System the generated code will
  60.     run. At most one of the these is true, the rest are false.
  61.  
  62.         TARGET_OS_MAC            - Generate code will run under Mac OS
  63.         TARGET_OS_WIN32            - Generate code will run under 32-bit Windows
  64.         TARGET_OS_UNIX            - Generate code will run under some unix 
  65.  
  66.  
  67.     TARGET_RT_≈    
  68.     These conditionals specify in which runtime the generated code will
  69.     run. This is needed when the OS and CPU support more than one runtime
  70.     (e.g. MacOS on 68K supports CFM68K and Classic 68k).
  71.  
  72.         TARGET_RT_LITTLE_ENDIAN    - Generated code uses little endian format for integers
  73.         TARGET_RT_BIG_ENDIAN    - Generated code uses big endian format for integers     
  74.         TARGET_RT_MAC_CFM        - TARGET_OS_MAC is true and CFM68K or PowerPC CFM being used    
  75.         TARGET_RT_MAC_68881        - TARGET_OS_MAC is true and 68881 floating point instructions used    
  76.  
  77.  
  78.     PRAGMA_≈
  79.     These conditionals specify whether the compiler supports particular #pragma's
  80.     
  81.         PRAGMA_IMPORT             - Compiler supports: #pragma import on/off/reset
  82.         PRAGMA_ONCE              - Compiler supports: #pragma once
  83.         PRAGMA_STRUCT_ALIGN      - Compiler supports: #pragma options align=mac68k/power/reset
  84.         PRAGMA_STRUCT_PACK        - Compiler supports: #pragma pack(n)
  85.         PRAGMA_STRUCT_PACKPUSH    - Compiler supports: #pragma pack(push, n)/pack(pop)
  86.         PRAGMA_ENUM_PACK         - Compiler supports: #pragma options(!pack_enums)
  87.         PRAGMA_ENUM_ALWAYSINT     - Compiler supports: #pragma enumsalwaysint on/off/reset
  88.         PRAGMA_ENUM_OPTIONS        - Compiler supports: #pragma options enum=int/small/reset
  89.  
  90.     FOUR_CHAR_CODE
  91.     This conditional does the proper byte swapping to assue that a four character code (e.g. 'TEXT')
  92.     is compiled down to the correct value on all compilers.
  93.  
  94.         FOUR_CHAR_CODE('abcd')    - Convert a four-char-code to the correct 32-bit value
  95.  
  96.     TYPE_≈
  97.     These conditionals specify whether the compiler supports particular types.
  98.  
  99.         TYPE_LONGLONG            - Compiler supports "long long" 64-bit integers
  100.         TYPE_BOOL                - Compiler supports "bool"
  101.         TYPE_EXTENDED            - Compiler supports "extended" 80/96 bit floating point
  102.  
  103. ***************************************************************************************************}
  104.  
  105. {$IFC NOT UNDEFINED MWERKS}
  106.     {
  107.         CodeWarrior Pascal compiler from Metrowerks, Inc.
  108.     }
  109.     {$IFC MAC68K}
  110.         {$SETC TARGET_CPU_PPC              := FALSE}
  111.         {$SETC TARGET_CPU_68K              := TRUE}
  112.         {$SETC TARGET_CPU_X86              := FALSE}
  113.         {$SETC TARGET_CPU_MIPS             := FALSE}
  114.         {$SETC TARGET_CPU_SPARC         := FALSE}
  115.         {$SETC TARGET_RT_MAC_CFM        := FALSE}
  116.         {$SETC TARGET_RT_MAC_68881        := OPTION(mc68881)}
  117.         {$SETC TARGET_OS_MAC            := TRUE}
  118.         {$SETC TARGET_OS_WIN32            := FALSE}
  119.         {$SETC TARGET_OS_UNIX            := FALSE}
  120.         {$SETC TARGET_RT_LITTLE_ENDIAN    := FALSE}
  121.         {$SETC TARGET_RT_BIG_ENDIAN        := TRUE}
  122.     {$ELSEC}
  123.         {$IFC POWERPC}
  124.             {$SETC TARGET_CPU_PPC              := TRUE}
  125.             {$SETC TARGET_CPU_68K              := FALSE}
  126.             {$SETC TARGET_CPU_X86              := FALSE}
  127.             {$SETC TARGET_CPU_MIPS             := FALSE}
  128.             {$SETC TARGET_CPU_SPARC         := FALSE}
  129.             {$SETC TARGET_RT_MAC_CFM        := TRUE}
  130.             {$SETC TARGET_RT_MAC_68881        := FALSE}
  131.             {$SETC TARGET_OS_MAC            := TRUE}
  132.             {$SETC TARGET_OS_WIN32            := FALSE}
  133.             {$SETC TARGET_OS_UNIX            := FALSE}
  134.             {$SETC TARGET_RT_LITTLE_ENDIAN    := FALSE}
  135.             {$SETC TARGET_RT_BIG_ENDIAN        := TRUE}
  136.         {$ELSEC}
  137.             {$IFC INTEL}
  138.                 {$SETC TARGET_CPU_PPC              := FALSE}
  139.                 {$SETC TARGET_CPU_68K              := FALSE}
  140.                 {$SETC TARGET_CPU_X86              := TRUE}
  141.                 {$SETC TARGET_CPU_MIPS             := FALSE}
  142.                 {$SETC TARGET_CPU_SPARC         := FALSE}
  143.                 {$SETC TARGET_RT_MAC_CFM        := FALSE}
  144.                 {$SETC TARGET_RT_MAC_68881        := FALSE}
  145.                 {$SETC TARGET_OS_MAC            := FALSE}
  146.                 {$SETC TARGET_OS_WIN32            := TRUE}
  147.                 {$SETC TARGET_OS_UNIX            := FALSE}
  148.                 {$SETC TARGET_RT_LITTLE_ENDIAN    := TRUE}
  149.                 {$SETC TARGET_RT_BIG_ENDIAN        := FALSE}
  150.             {$ELSEC}
  151.                 Error unknown compiler targer
  152.             {$ENDC}
  153.         {$ENDC}
  154.     {$ENDC}    
  155.     {$SETC TYPE_EXTENDED                := TRUE}
  156.     {$SETC TYPE_LONGLONG                := FALSE}
  157.     {$SETC TYPE_BOOL                    := FALSE}
  158. {$ELSEC} 
  159.  
  160.  
  161. {$IFC NOT UNDEFINED THINK}
  162.     {
  163.         THINK Pascal compiler from Symantec, Inc.     << WARNING: Unsupported Compiler >>
  164.     }
  165.     {$SETC TARGET_CPU_68K                  := 1}
  166.     {$SETC TARGET_CPU_PPC                  := 0}
  167.     {$SETC TARGET_CPU_X86                  := 0}
  168.     {$SETC TARGET_CPU_MIPS                 := 0}
  169.     {$SETC TARGET_CPU_SPARC             := 0}
  170.     {$SETC TARGET_RT_MAC_CFM            := 0}
  171.     {$SETC TARGET_RT_MAC_68881            := OPTION(mc68881)}
  172.     {$SETC TARGET_OS_MAC                := 1}
  173.     {$SETC TARGET_OS_WIN32                := 0}
  174.     {$SETC TARGET_OS_UNIX                := 0}
  175.     {$SETC TARGET_RT_LITTLE_ENDIAN        := 0}
  176.     {$SETC TARGET_RT_BIG_ENDIAN            := 1}
  177.     {$SETC TYPE_EXTENDED                := 1}
  178.     {$SETC TYPE_LONGLONG                := 0}
  179.     {$SETC TYPE_BOOL                    := 0}
  180. {$ELSEC}
  181.  
  182.  
  183.     {
  184.         MPW Pascal compiler from Apple Computer, Inc.     << WARNING: Unsupported Compiler >>
  185.     }
  186.     {$SETC TARGET_CPU_68K                  := 1}
  187.     {$SETC TARGET_CPU_PPC                  := 0}
  188.     {$SETC TARGET_CPU_X86                  := 0}
  189.     {$SETC TARGET_CPU_MIPS                 := 0}
  190.     {$SETC TARGET_CPU_SPARC             := 0}
  191.     {$SETC TARGET_RT_MAC_CFM            := 0}
  192.     {$SETC TARGET_RT_MAC_68881            := OPTION(mc68881)}
  193.     {$SETC TARGET_OS_MAC                := 1}
  194.     {$SETC TARGET_OS_WIN32                := 0}
  195.     {$SETC TARGET_OS_UNIX                := 0}
  196.     {$SETC TARGET_RT_LITTLE_ENDIAN        := 0}
  197.     {$SETC TARGET_RT_BIG_ENDIAN            := 1}
  198.     {$SETC TYPE_EXTENDED                := 1}
  199.     {$SETC TYPE_LONGLONG                := 0}
  200.     {$SETC TYPE_BOOL                    := 0}
  201. {$ENDC}
  202. {$ENDC}
  203.  
  204.  
  205.  
  206.  
  207.  
  208. {***************************************************************************************************
  209.     Backward compatibility for clients expecting 2.x version on ConditionalMacros.h
  210.  
  211.     GENERATINGPOWERPC        - Compiler is generating PowerPC instructions
  212.     GENERATING68K            - Compiler is generating 68k family instructions
  213.     GENERATING68881            - Compiler is generating mc68881 floating point instructions
  214.     GENERATINGCFM            - Code being generated assumes CFM calling conventions
  215.     CFMSYSTEMCALLS            - No A-traps.  Systems calls are made using CFM and UPP's
  216.     PRAGMA_ALIGN_SUPPORTED    - Compiler supports: #pragma options align=mac68k/power/reset
  217.     PRAGMA_IMPORT_SUPPORTED    - Compiler supports: #pragma import on/off/reset
  218.  
  219. ***************************************************************************************************}
  220. {$SETC GENERATINGPOWERPC := TARGET_CPU_PPC }
  221. {$SETC GENERATING68K := TARGET_CPU_68K }
  222. {$SETC GENERATING68881 := TARGET_RT_MAC_68881 }
  223. {$SETC GENERATINGCFM := TARGET_RT_MAC_CFM }
  224. {$SETC CFMSYSTEMCALLS := TARGET_RT_MAC_CFM }
  225. {
  226.     NOTE: The FOR_≈ conditionals were developed to produce integerated
  227.           interface files for System 7 and Copland.  Now that Copland
  228.           is canceled, all FOR_ conditionals have been removed from
  229.           the interface files.  But, just in case you someone got an 
  230.           interface file that uses them, the following sets the FOR_≈
  231.           conditionals to a consistent, usable state.
  232. }
  233. {$SETC FOR_OPAQUE_SYSTEM_DATA_STRUCTURES := 0 }
  234. {$IFC UNDEFINED FOR_PTR_BASED_AE }
  235. {$SETC FOR_PTR_BASED_AE := 0 }
  236. {$ENDC}
  237.  
  238. {$SETC FOR_SYSTEM7_ONLY := 1 }
  239. {$SETC FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED := 1 }
  240. {$SETC FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE := 1 }
  241. {$SETC FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE := 1 }
  242. {$SETC FOR_SYSTEM8_COOPERATIVE := 0 }
  243. {$SETC FOR_SYSTEM8_PREEMPTIVE := 0 }
  244.  
  245.  
  246.  
  247. {***************************************************************************************************
  248.  
  249.     OLDROUTINENAMES            - "Old" names for Macintosh system calls are allowed in source code.
  250.                               (e.g. DisposPtr instead of DisposePtr). The names of system routine
  251.                               are now more sensitive to change because CFM binds by name.  In the 
  252.                               past, system routine names were compiled out to just an A-Trap.  
  253.                               Macros have been added that each map an old name to its new name.  
  254.                               This allows old routine names to be used in existing source files,
  255.                               but the macros only work if OLDROUTINENAMES is true.  This support
  256.                               will be removed in the near future.  Thus, all source code should 
  257.                               be changed to use the new names! You can set OLDROUTINENAMES to false
  258.                               to see if your code has any old names left in it.
  259.     
  260.     OLDROUTINELOCATIONS     - "Old" location of Macintosh system calls are used.  For example, c2pstr 
  261.                               has been moved from Strings to TextUtils.  It is conditionalized in
  262.                               Strings with OLDROUTINELOCATIONS and in TextUtils with !OLDROUTINELOCATIONS.
  263.                               This allows developers to upgrade to newer interface files without 
  264.                               having to change the includes in their source code.  But, it allows
  265.                               the slow migration of system calls to more understandable file locations.  
  266.                               OLDROUTINELOCATIONS currently defaults to true, but eventually will 
  267.                               default to false.
  268.  
  269. ***************************************************************************************************}
  270. {$IFC UNDEFINED OLDROUTINENAMES }
  271. {$SETC OLDROUTINENAMES := 0 }
  272. {$ENDC}
  273.  
  274. {$IFC UNDEFINED OLDROUTINELOCATIONS }
  275. {$SETC OLDROUTINELOCATIONS := 0 }
  276. {$ENDC}
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284. {$SETC UsingIncludes := ConditionalMacrosIncludes}
  285.  
  286. {$ENDC} {__CONDITIONALMACROS__}
  287.  
  288. {$IFC NOT UsingIncludes}
  289.  END.
  290. {$ENDC}
  291.